﻿<cfscript>
/** 
* DataBase Frameworks - Sequence
* 
* @hint "DataBase Frameworks - Sequence - EvaluateSystem" 
*/ 

component 
	displayname="public.service.db.senate.sequence.EvaluateSystem" 
	output=false 
	accessors=true 
	{
		
	/**
	* @hint "初始化对象"
	*/
	public function init() output=false {
		return this;
	}
	
	/**
	* @hint "自定义主键规则"
	*/
	public string function getID() output=false {
		
		var nextID = numberFormat(1, "0_");
		
		var sql = "SELECT es_id FROM t_evaluate_system ORDER BY es_id DESC ";
		
		var queryObj = new Query( datasource=application.dnsMaster, maxRows=1 );
		
		var rs_check = queryObj.execute( sql=sql ).getResult();
		
		if ( rs_check.recordCount ) {
			/* 创建一个追加id */
			nextID = numberFormat( ( rs_check.es_id + 1 ), "0_" );
		}
		
		return nextID;
		
	}
		
}
	
</cfscript>